import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'index.dart';

class MyPublishPage extends GetView<MyPublishController> {
  const MyPublishPage({super.key});

  // 构建导航标签
  Widget _buildNavTab(String title) {
    return GestureDetector(
      onTap: () {
        // Handle tab switching if needed
      },
      child: Text(
        title,
        style: const TextStyle(
          fontSize: 14,
          color: Colors.white,
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // 使用 Scaffold 并设置透明的 AppBar 来优雅地处理顶部安全区域
      backgroundColor: const Color(0xFFE33641),
      extendBodyBehindAppBar: true, // 允许body内容延伸到AppBar后面
      appBar: AppBar(
        backgroundColor: Colors.transparent, // AppBar 透明
        elevation: 0, // 移除阴影
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const Padding(
            padding: EdgeInsets.only(left: 16, top: kToolbarHeight + 40, bottom: 16),
            child: Text(
              "活动管理",
              style: TextStyle(
                fontSize: 18,
                fontWeight: FontWeight.bold,
                color: Colors.white,
              ),
            ),
          ),
          Container(
            alignment: Alignment.center,
            padding: const EdgeInsets.symmetric(vertical: 30),
            child: const Text(
              "无",
              style: TextStyle(fontSize: 16, color: Colors.white),
            ),
          ),
          // History navigation tabs
          Container(
            padding: const EdgeInsets.symmetric(vertical: 10),
            alignment: Alignment.center,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                _buildNavTab("历史活动"),
                Container(
                  height: 12,
                  width: 1,
                  color: Colors.white.withOpacity(0.5),
                  margin: const EdgeInsets.symmetric(horizontal: 10),
                ),
                _buildNavTab("我的评论"),
                Container(
                  height: 12,
                  width: 1,
                  color: Colors.white.withOpacity(0.5),
                  margin: const EdgeInsets.symmetric(horizontal: 10),
                ),
                _buildNavTab("我参与的"),
              ],
            ),
          ),
          Container(
            alignment: Alignment.center,
            padding: const EdgeInsets.symmetric(vertical: 30),
            child: const Text(
              "无",
              style: TextStyle(fontSize: 16, color: Colors.white),
            ),
          ),
        ],
      ),
    );
  }
}
